using System;
using System.Diagnostics.Contracts;

namespace ReactiveCode
{
    public interface IReactive : IDisposable
    {
        bool Enabled { get; set; }
    }

    [ContractClass(typeof(IReactiveContractClass<>))]
    public interface IReactive<T> : IReactive
    {
        IObservable<T> Value { get; }
    }

    #region IReactive<T> contract

    [ContractClassFor(typeof(IReactive<>))]
    abstract class IReactiveContractClass<T>: IReactive<T>
    {
        public bool Enabled
        {
            get { throw new NotImplementedException(); }
            set { }
        }
        public IObservable<T> Value
        {
            get
            {
                Contract.Ensures(Contract.Result<IObservable<T>>() != null);
                throw new NotImplementedException();
            }
        }

        public void Dispose() { }
    }

    #endregion

}